package cn.wit.luohui.day09;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.chart.LineChart;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class DemoLineChart extends Application {

	@Override
	public void start(Stage primaryStage) throws Exception {
		VBox box=new VBox();//创建一个容器
		//所有分数
		Map<String,Map<String,Number>>allScores=new HashMap<>();
		
		//LineChart<String,Number> linechart=new LineChart<>(xAxis,yAxis);
		
		Map<String,Number>scores=new HashMap<>();
		scores.put("aaa", 88);
		scores.put("bbb", 55);
		scores.put("ccc", 32);
		allScores.put("语文成绩", scores);//放所有的语文成绩
		
		scores = new HashMap<>();
		scores.put("aaa", 100);
		scores.put("bbb", 99);
		scores.put("ccc", 99);
		scores.put("ddd", 59);
		allScores.put("数学成绩", scores);//放所有的数学成绩
		
		scores = new HashMap<>();
		scores.put("aaa", 100);
		scores.put("bbb", 99);
		scores.put("ccc", 99);
		scores.put("ddd", 59);
		allScores.put("英语成绩", scores);//放所有英语成绩
		
		//创建表格放所有成绩
		List<LineChart<String, Number>> charts = ChartUtils.createLineCharts(allScores);
	box.getChildren().addAll(charts);
	
	Scene scene = new Scene(box);
	primaryStage.setScene(scene);
	
	primaryStage.show();
	}
	
	public static void main(String[] args) {
		launch(args);
}
}
